package com.byxm.wlgw.service;

import java.sql.ResultSet;
import java.util.ArrayList;
import java.util.List;

import com.byxm.wlgw.bean.JgqjBean;
import com.byxm.wlgw.common.DataBaseAccess;
import com.byxm.wlgw.query.JgqjQuery;

public class JgqjService {
	/**
	 * 
	 * 获取价格区间
	 * @return
	 * @throws Exception
	 */
	public List<JgqjBean> getJgqj() {
		JgqjQuery jgqjQuery=new JgqjQuery("tb_splb_s");
		String sql = jgqjQuery.getJgqjSql();
		DataBaseAccess dba=null;
		List<JgqjBean> list=new ArrayList<JgqjBean>();
		
		try {
			dba = new DataBaseAccess();
			ResultSet rs = dba.executeQuery(sql);
			while (rs.next()) {	
				JgqjBean jgqj=new JgqjBean();
				jgqj.setJgqjid(rs.getInt("jgqjid"));
				jgqj.setJgqjnr(rs.getString("jgqjnr"));
				list.add(jgqj);
				}
			rs.close();
		} catch (Exception e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}finally{
			try {
				dba.releaseConnect();
			} catch (Exception e) {
				// TODO Auto-generated catch block
				e.printStackTrace();
			}
		}
		return list;
	}
}